package com.dragon.test.springbootdemo.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: longtao
 * @Date: 2019/6/4
 * @Version: 1.0
 * @Description:
 */
@Controller
@Slf4j
public class ResponseController {


    @ResponseBody
    @RequestMapping(value = "/res/fun1")
   public ResponseEntity fun1(){
        log.debug("abc[{}]def[{}]ghi[{}]","111","222","333");

        Map model= new HashMap();
        model.put("msg","fun1 some message.....");

        ResponseEntity<Map> res = new ResponseEntity<>(model, HttpStatus.ACCEPTED); //============================
        return res;
    }


    @ResponseStatus(value = HttpStatus.ACCEPTED) //=====================================
    @ResponseBody
    @RequestMapping(value = "/res/fun2")
    public Map fun2(){
        Map model= new HashMap();
        model.put("msg","fun2 some message.....");

        return model;
    }




}
